//
// Created by Tony on 2024/5/24.
//

#include "VarDefStmt.h"
#include "../../../../compiler/Visitor.h"

namespace Parser {

void VarDefStmt::setName(const shared_ptr<Name>& name) {
    this->varName = name;
    this->children.push_back(name);
}

void VarDefStmt::setTypeTag(const shared_ptr<TypeTag>& typeTag) {
    this->typeTag = typeTag;
    this->children.push_back(typeTag);
}

void VarDefStmt::setInitExpr(const shared_ptr<Ast>& expr) {
    this->initExpr = expr;
    this->children.push_back(expr);
}

int32_t VarDefStmt::accept(Compiler::Visitor* visitor) { return visitor->visit(this); }

} // namespace Parser